<?=$this->load->view('include_header',null)?>
	<div id="top-panel">
		<div id="panel">
			<ul>
				<li class="current"><a href="<?=site_url('archive/idcard/'.$id)?>" class="report"><?=(empty($id))?"录入新":"编辑"?>客户基本信息</a></li>
				<?php if(!empty($info->id)):?><li><a id="printInfo" class="folder_table">打印本页信息</a></li><?php endif;?>
			</ul>
		</div>
	</div>
	<div id="wrapper">
		<div id="content">
			<div id="box">
<!-- table begin -->
<form method="post" id="form"  enctype="multipart/form-data" action="<?=site_url('schengen/ma_update/'.$cateid)?>">

	<h3>摩洛哥申请表</h3>
    <table width="100%">
    <thead>
        <tr>
          <td colspan="4" align="right"><img src="<?= (@$info->avatar)?@$info->avatar:'images/avatar.gif'?>" width="150" height="150" /></td>
		  <td align="right">
		  上传照片<br />
		  <input type="file" name="userphoto" /><br />
		  (.gif|.jpg|.png文件,最大1M)<br />
		  <?php if (@$info->attachment):?><a href="<?= @$info->attachment?>" target="_blank">点击下载附件</a><?php endif; ?>
		  &nbsp;&nbsp;&nbsp;&nbsp;上传附件<br />
		  <input type="file" name="userfile" /><br />
		  (.pdf|.zip|.rar|.doc,最大2M)		  
		  </td>
        </tr>
    </thead>
    <tfoot>
        <tr>
            <td colspan="5" align="right">			
			<input type="hidden" name="id" value="<?=$id?>" />
			<input id="button1" type="submit" value="提交信息" />
			<input id="button2" type="reset" value="重置" />
			</td>
        </tr>
    </tfoot>

    <tbody>
        <tr class="odd">
            <td>1. First Name(s)</td>
            <td><input type="text" name="firstname" value="<?= @$info->firstname?>" /></td>
            <td>&nbsp;</td>
            <td>2. Family Name(s) </td>
            <td><input type="text" name="surname" value="<?= @$info->surname?>" /></td>
        </tr>
        <tr class="even">
            <td>3. Date of Birth </td>
            <td><select name="birth_d"><?php for($i=1;$i<=31;$i++) echo "<option value='$i'".((@$info->birth_d==$i)?"selected":"").">$i</option>"; ?></select> - 
			<select name="birth_m"><?php for($i=1;$i<=12;$i++) echo "<option value='$i'".((@$info->birth_m==$i)?"selected":"").">$i</option>"; ?></select> - 
			<select name="birth_y"><?php for($i=date("Y");$i>1940;$i--) echo "<option value='$i'".((@$info->birth_y==$i)?"selected":"").">$i</option>"; ?></select></td>
            <td>&nbsp;</td>
            <td>4. Identity Card Number(For minors write mention <minors>) </td>
            <td><input type="text" name="national_id" value="<?= @$info->national_id?>" /></td>
        </tr>
        <tr class="odd">
            <td>5. Place and Country of Birth</td>
            <td colspan="4"><input type="text" name="birth_place" value="<?= @$info->birth_place?>" style="width:300px"/>
            &nbsp;</td>
        </tr>
        <tr class="even">
            <td>6. Current Nationality</td>
            <td><input type="text" name="cur_nationality" value="<?= @$info->cur_nationality?>" /></td>
            <td>&nbsp;</td>
            <td>7. Original Nationality(Nationality of birth)</td>
            <td><input type="text" name="ori_nationality" value="<?= @$info->ori_nationality?>" /></td>
        </tr>
        <tr class="odd">
		    <td>8. Sex</td>
			<td><input type="radio" name="sex" value="1" <?= (@$info->sex==1)?'checked':''?> />Male
<input type="radio" name="sex" value="2" <?= (@$info->sex==2)?'checked':''?> />Female</td>
			<td>&nbsp;</td>
            <td>9. Marital situation</td>
            <td colspan="4">
			<input type="radio" name="marital_status" value="1" <?= (@$info->marital_status==1)?'checked':''?>/> 
			Single  &nbsp;&nbsp;
			<input type="radio" name="marital_status" value="2" <?= (@$info->marital_status==2)?'checked':''?>/>			 Married
            <input type="radio" name="marital_status" value="3" <?= (@$info->marital_status==3)?'checked':''?>/> 
            Separated  <br />
            <input type="radio" name="marital_status" value="4" <?= (@$info->marital_status==4)?'checked':''?>/> 
            Divorced  
            <input type="radio" name="marital_status" value="5" <?= (@$info->marital_status==5)?'checked':''?>/>             Widow (er) 
            <input type="radio" name="marital_status" value="6" <?= (@$info->marital_status==6)?'checked':''?>/> 
            Other </td>
        </tr>
        <tr class="even">
          <td>10. Father’s Name and Family Name</td>
		  <td><input type="text" name="father_name" value="<?= @$info->father_name?>" /></td>
		  <td>&nbsp;</td>
		  <td>11. Mother’s Name and Family Name</td>
		  <td><input type="text" name="mother_name" value="<?= @$info->mother_name?>" /></td>
        </tr>
        <tr class="odd">
            <td>12. Type of  Passport</td>
            <td colspan="4">
 <input type="radio" name="travel_document_type" value="1" <?= (@$info->travel_document_type==1)?'checked':''?>/> Ordinary Passport 
 <input type="radio" name="travel_document_type" value="2" <?= (@$info->travel_document_type==2)?'checked':''?>/> Diplomatical Passport 
 <input type="radio" name="travel_document_type" value="3" <?= (@$info->travel_document_type==3)?'checked':''?>/> Service Passport or Equivalent <br />
 <input type="radio" name="travel_document_type" value="4" <?= (@$info->travel_document_type==4)?'checked':''?>/> Travel document for refugier or apatried  
 <input type="radio" name="travel_document_type" value="5" <?= (@$info->travel_document_type==5)?'checked':''?>/> Other</td>
        </tr>
        <tr class="even">
            <td>13. Passport Number And Serial Number</td>
			<td colspan="4">Passport Number<input type="text" name="travel_document_num" value="<?= @$info->travel_document_num?>" />&nbsp;Serial Number<input type="text" name="travel_document_sn" value="<?= @$info->travel_document_sn?>" /></td>
        </tr>
        <tr class="odd">
            <td>14. Issued by</td>
            <td><input type="text" name="travel_document_issue_by" value="<?= @$info->travel_document_issue_by?>" /></td>
            <td>&nbsp;</td>
            <td>15. Date of issue</td>
            <td><input type="text" name="travel_document_issue_date" value="<?= @$info->travel_document_issue_date?>" id="travel_document_issue_date" /></td>
        </tr>
        <tr class="even">
            <td>16. Valid until</td>
            <td><input type="text" name="travel_document_valid_date" value="<?= @$info->travel_document_valid_date?>" id="travel_document_valid_date" /></td>
            <td>&nbsp;</td>
            <td>17. Profession</td>
            <td><input type="text" name="profession" value="<?= @$info->profession?>" /></td>
        </tr>
		        <tr class="odd">
            <td>18. Purpose of Travel</td>
            <td colspan="4">
 <input type="radio" name="purpose" value="1" <?= (@$info->purpose==1)?'checked':''?>/> Tourism 
 <input type="radio" name="purpose" value="2" <?= (@$info->purpose==2)?'checked':''?>/> Affairs
 <input type="radio" name="purpose" value="3" <?= (@$info->purpose==3)?'checked':''?>/> Family visit 
 <input type="radio" name="purpose" value="4" <?= (@$info->purpose==4)?'checked':''?>/> Culture/Sport
 <input type="radio" name="purpose" value="5" <?= (@$info->purpose==5)?'checked':''?>/> Official visit
 <input type="radio" name="purpose" value="6" <?= (@$info->purpose==6)?'checked':''?>/> Medical Purpose
 <input type="radio" name="purpose" value="7" <?= (@$info->purpose==7)?'checked':''?>/> Studies
 <input type="radio" name="purpose" value="8" <?= (@$info->purpose==8)?'checked':''?>/> Other(Precise) </td>
        </tr>
        <tr class="even">
            <td>19. Type of visa</td>
            <td><input type="radio" name="visa_type" value="1" <?= (@$info->visa_type==1)?'checked':''?>/>
Long validity<br/>
  <input type="radio" name="visa_type" value="2" <?= (@$info->visa_type==2)?'checked':''?>/>
Short validity<br/>
<input type="radio" name="visa_type" value="3" <?= (@$info->visa_type==3)?'checked':''?>/>
Transit </td>
            <td>&nbsp;</td>
            <td>20. Number of entries</td>
            <td><input type="radio" name="entry_num" value="1" <?= (@$info->entry_num==1)?'checked':''?>/>
Single entry<br/>
  <input type="radio" name="entry_num" value="2" <?= (@$info->entry_num==2)?'checked':''?>/>
Two entries<br/>
<input type="radio" name="entry_num" value="3" <?= (@$info->entry_num==3)?'checked':''?>/>
Multiple entries </td>
        </tr>		
        <tr class="odd">
            <td>21. Duration of stay</td>
			<td>Number of days<input type="text" name="stay_length" value="<?= @$info->stay_length?>" /></td>
			<td>&nbsp;</td>
			<td>22. Arrival date</td>
			<td><input type="text" name="arrival_date" value="<?= @$info->arrival_date?>" id="arrival_date" /></td>
        </tr>
        <tr class="even">
            <td>23. Border of entry or transit route</td>
            <td><input type="text" name="entry_border" value="<?= @$info->entry_border?>"/></td>
            <td>&nbsp;</td>
            <td>24. Mean of transit</td>
            <td><input type="text" name="transit_mean" value="<?= @$info->transit_mean?>"/></td>
        </tr>
        <tr class="odd">
			<td colspan="5">
			25. Previous visas<br />
			1.Date<input type="text" name="pre_visa1_date" value="<?= @$info->pre_visa1_date?>" id="pre_visa1_date" /> &nbsp;Number<input type="text" name="pre_visa1_num" value="<?= @$info->pre_visa1_num?>" />&nbsp;Place of issue<input type="text" name="pre_visa1_place" value="<?= @$info->pre_visa1_place?>" />&nbsp;Duration<input type="text" name="pre_visa1_duration" value="<?= @$info->pre_visa1_duration?>" /><br />
			2.Date<input type="text" name="pre_visa2_date" value="<?= @$info->pre_visa2_date?>" id="pre_visa2_date" /> &nbsp;Number<input type="text" name="pre_visa2_num" value="<?= @$info->pre_visa2_num?>" />&nbsp;Place of issue<input type="text" name="pre_visa2_place" value="<?= @$info->pre_visa2_place?>" />&nbsp;Duration<input type="text" name="pre_visa2_duration" value="<?= @$info->pre_visa2_duration?>" /><br />
			3.Date<input type="text" name="pre_visa3_date" value="<?= @$info->pre_visa3_date?>" id="pre_visa3_date" /> &nbsp;Number<input type="text" name="pre_visa3_num" value="<?= @$info->pre_visa3_num?>" />&nbsp;Place of issue<input type="text" name="pre_visa3_place" value="<?= @$info->pre_visa3_place?>" />&nbsp;Duration<input type="text" name="pre_visa3_duration" value="<?= @$info->pre_visa3_duration?>" /></td>
        </tr>
        <tr class="even">
            <td>26. In case of transit, have you un entry permit to entry to Final country</td>
            <td colspan="4">
              <input type="radio" name="is_entry_permit" value="0" <?= (@$info->is_entry_permit==0)?'checked':''?>/> No<br />
			  <input type="radio" name="is_entry_permit" value="1" <?= (@$info->is_entry_permit==1)?'checked':''?>/> Yes <br />
			  Country of destination
			  <input type="text" name="destination" value="<?= @$info->destination?>" />
			  Valid until<input type="text" name="destination_vaild" value="<?= @$info->destination_vaild?>" id="destination_vaild"/>
			  Delivered by<input type="text" name="destination_delivered" value="<?= @$info->destination_delivered?>" /></td>
        </tr>

        <tr class="odd">
            <td>27.Host or Host company  (If not, indicate name or a temporary address in Morocco)</td>
            <td colspan="4">Name
              <input type="text" name="host_name" value="<?= @$info->host_name?>" />     Adress
              <input type="text" name="host_address" value="<?= @$info->host_address?>" style="width:300px" /><br />
			  Telephone Number<input type="text" name="host_tel" value="<?= @$info->host_tel?>" />  
			  Fax<input type="text" name="host_fax" value="<?= @$info->host_fax?>" />  
			  Email<input type="text" name="host_email" value="<?= @$info->host_email?>" id="host_email" /></td>
        </tr>
        <tr class="even">
            <td>28. Who is paying for your travel and your needs during your stay?</td>
			<td colspan="4">
<input type="radio" name="who_pay" value="1" <?= (@$info->who_pay==1)?'checked':''?>/>My self 
<input type="radio" name="who_pay" value="2" <?= (@$info->who_pay==2)?'checked':''?>/>Host(s) 
<input type="radio" name="who_pay" value="3" <?= (@$info->who_pay==3)?'checked':''?>/>Host Company(Indicate the names and the modalities and present corresponding documentation) <input type="text" name="who_pay_other" value="<?= @$info->who_pay_other?>" style="width:300px" /></td>
        </tr>
        <tr class="odd">
            <td>29. Financial Means used during your stay</td>
            <td colspan="4">Moyens de financement utilisés au cours du séjours:<br/>
<input type="radio" name="financial_means" value="1" <?= (@$info->financial_means==1)?'checked':''?>/>Money(Cash) 
<input type="radio" name="financial_means" value="2" <?= (@$info->financial_means==2)?'checked':''?>/>Traveller Cheques
<input type="radio" name="financial_means" value="3" <?= (@$info->financial_means==3)?'checked':''?>/>Credit Card
<input type="radio" name="financial_means" value="4" <?= (@$info->financial_means==4)?'checked':''?>/>Accomodation<br/>
<input type="radio" name="financial_means" value="5" <?= (@$info->financial_means==5)?'checked':''?>/>Others<input type="text" name="financial_means_other" value="<?= @$info->financial_means_other?>" /><br />
<input type="radio" name="financial_means" value="6" <?= (@$info->financial_means==6)?'checked':''?>/>Travel Insurance and/or Medical Insurance-Valid until<input type="text" name="financial_means_valid" value="<?= @$info->financial_means_valid?>" id="financial_means_valid" /></td>
        </tr>
        <tr class="even">
            <td>30. Children (individual application for each passport)</td>
            <td colspan="4">
			1.Family Name<input type="text" name="child1_surname" value="<?= @$info->child1_surname?>" /> First Name<input type="text" name="child1_firstname" value="<?= @$info->child1_firstname?>" /> Date of birth<input type="text" name="child1_birth" value="<?= @$info->child1_birth?>" id="child1_birth" /><br />
			2.Family Name<input type="text" name="child2_surname" value="<?= @$info->child2_surname?>" /> First Name<input type="text" name="child2_firstname" value="<?= @$info->child2_firstname?>" /> Date of birth<input type="text" name="child2_birth" value="<?= @$info->child2_birth?>" id="child2_birth" /><br />
			3.Family Name<input type="text" name="child3_surname" value="<?= @$info->child3_surname?>" /> First Name<input type="text" name="child3_firstname" value="<?= @$info->child3_firstname?>" /> Date of birth<input type="text" name="child3_birth" value="<?= @$info->child3_birth?>" id="child3_birth" /></td>
        </tr>
        <tr class="odd">
            <td colspan="5">I declare that all information I advanced is correct and complete. I am conscious  of the fact that any false declaration will lead to the rejection of application to the annulment of the visa if already issued and may lead to legal proceeding according to the regulations in force in Morocco.<br/>
Note:<br/>
-	In addition to your valid passport and visa, you should be able during  your passage through the Moroccan frontier to present all documents that may justify your return and your stay, your subsistence means, insurance statement, etc
-	Entry to the Moroccan territory may be refused to the alien who does not fulfil all these requirements.
Providing all the required documents does not necessarily open right to visa.
</td>
        </tr>
        <tr class="even">
            <td>31. Applicant’s adress</td>
            <td><input type="text" name="app_address" value="<?= @$info->app_address?>" /></td>
            <td>&nbsp;</td>
            <td>32. Phone And Email</td>
            <td>Phone <input type="text" name="app_tel" value="<?= @$info->app_tel?>" /><br/>
			Email <input type="text" name="app_email" value="<?= @$info->app_email?>" id="app_email" /></td>
        </tr>
        <tr class="odd">
            <td>33. Done in</td>
			<td><input type="text" name="done_in" value="<?= @$info->done_in?>" /></td>
			<td>&nbsp;</td>
			<td>34. Firm</td>
			<td><input type="text" name="firm" value="<?= @$info->firm?>" /></td>
        </tr>
        
    </tbody>
	</table>
<!-- table end -->
</form>

			</div>
		</div>
		
		<?=$this->load->view('include_sidebar',array('id'=>$id,'forms'=>$forms))?>
	</div>

<script type="text/javascript">
$().ready(function() {
  $("#form").validate({
    rules: {
		surname:"required",
		firstname:"required",
		travel_document_num:"required",
		travel_document_issue_by:"required",
		travel_document_valid_date:"required",
		travel_document_issue_date:"required",
		sex:"required",
		cur_nationality:"required",
		marital_status:"required",
		national_id:"required",
		travel_document_type:"required",
		purpose:"required",
		visa_type:"required",
		entry_num:"required",
		who_pay:"required",
		financial_means:"required"
    }
  });
  
	$.datepicker.setDefaults(
		{
		dateFormat: 'dd/mm/yy',
		changeMonth: true,
		changeYear: true,
		showOn: "both",
		buttonImage: "images/calendar.gif",
		buttonImageOnly: true
		}
	);

	$("#travel_document_issue_date").datepicker();
	$("#travel_document_valid_date").datepicker();
	$("#arrival_date").datepicker();
	$("#pre_visa1_date").datepicker();
	$("#pre_visa2_date").datepicker();
	$("#pre_visa3_date").datepicker();
	$("#destination_vaild").datepicker();
	$("#financial_means_valid").datepicker();
	$("#child1_birth").datepicker();
	$("#child2_birth").datepicker();
	$("#child3_birth").datepicker();
	
	$("#host_email").autoMail();
	$("#app_email").autoMail();

	$("#printInfo").click(function(o) {
		var prints = [
			{rel_id: <?=$cateid?>, rec_id: <?=$id?>}
		]  ;
		
		var jdata = JSON.stringify(prints);
		//alert(jdata);
		$.post("<?=site_url('proxy/does/'.str_replace('==','',base64_encode('http://'.$_SERVER['SERVER_NAME'].':9090/javaprduct/servlet/test')))?>",{clients:jdata},function(msg){alert(msg)});
	});
	
	$("#printInfo").ajaxError(function(event,request, settings){
		//$(this).append("<li>出错页面:" + settings.url + "</li>");
		alert("无法访问"+ settings.url );
	}); 
 
});
</script>

<?=$this->load->view('include_footer',null)?>